#!/usr/bin/python3
# author luke
# 2024年02月25日
arr = [1,2,3,5,6,7,8,9,14,15]
def bsearch(arr,val):
    left = 0
    right =len(arr)-1

    while left <= right:
        mid = left + right >> 1
        if arr[mid] < val:
            left = mid +1
        elif arr[mid] > val:
            right = mid -1
        else:
            return  True
    return False

if __name__ == '__main__':
    print(bsearch(arr,4))